package main

import (
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/canvas"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/layout"
	"image/color"
)

func main() {
	myApp := app.New()
	myWindow := myApp.NewWindow("Container")
	green := color.NRGBA{R: 0, G: 180, B: 0, A: 255}
	myApp.Driver()
	/*	text1 := canvas.NewText("Hello", green)
		text2 := canvas.NewText("There", green)
		text2.Move(fyne.NewPos(20, 20))
		content := container.NewHBox(text1, text2)
		// content := container.New(layout.NewGridLayout(2), text1, text2)

		myWindow.SetContent(content)
		myWindow.ShowAndRun()*/

	text1 := canvas.NewText("你好", green)
	text2 := canvas.NewText("在那里", green)
	text3 := canvas.NewText("(右侧)", green)
	content := container.New(layout.NewHBoxLayout(), text1, text2, layout.NewSpacer(), text3)

	text4 := canvas.NewText("居中", green)
	centered := container.New(layout.NewHBoxLayout(), layout.NewSpacer(), text4, layout.NewSpacer())
	myWindow.SetContent(container.New(layout.NewVBoxLayout(), content, centered))
	myWindow.ShowAndRun()
}
